using System;

namespace PropertyExpression.ControllableQuery.Toolkit.Test.Queries
{
    public interface IError3QueryInfo
    {
        Guid PublicationId { get; }
        string ModelCode { get; }
        string ModelSequence { get; }
    }

    public class Error3Query : IQuery<IError3QueryInfo>
    {
        private readonly IParam<string> modelCode;
        private readonly IParam<string> modelSequence;

        public Error3Query(
            IParam<string> modelCode,
            IParam<string> modelSequence)
        {
            this.modelCode = modelCode;
            this.modelSequence = modelSequence;
        }

        public string TransformText()
        {
            modelCode.ToSql("@p1");
            modelSequence.ToSql("@p1");
            return @"SELECT
    ModelPublication.PublicationId,
    ModelPublication.ModelCode,
    ModelPublication.ModelSequence
FROM
    ModelPublication
WHERE
    ModelPublication.ModelCode = @p1
    AND ModelPublication.ModelSequence = @p1";
        }
    }
}